$(document).ready(function () {
    $("#commentForm").validate({
        //重写showErrors
        showErrors: function (errorMap, errorList) {
            var msg = "";
            $.each(errorList, function (i, v) {
                layer.tips(v.message, v.element, { time: 2000 });
                return false;
            });  
        },
        /* 失去焦点时验证 */
        onfocusout: function(element) { $(element).valid(); },
        /*  键盘抬起不验证 */
        onkeyup:false,
    });
    
    $("#creditinfod").validate({
         rules: {
      	   amountExec:{
                 allMoney: true
             },
             amountLawsuit1:{
                allMoney: true
            },
            amounttotal1:{
         	   allMoney: true 
            },
            telCourtUndertake1:{
         	   telPhone: true
            },
            judge_preserve1:{
            	chinese:true
            },
            telClerk1:{
         	   telPhone: true
            },
            feeAnnouncement1:{
                allMoney: true
            },
            amountPreserve1:{
                allMoney: true
            },
            feePreserve1:{
                allMoney: true
            },
            amountBack1:{
                allMoney: true
            },
            amountLawsuit2:{
                allMoney: true
            },
            telCourtUndertake2:{
         	   telPhone: true
            },
            telClerk2:{
         	   telPhone: true
            },
            feeAnnouncement2:{
                allMoney: true
            },
            amountPreserve2:{
                allMoney: true
            },
            amounttotal2:{
          	   allMoney: true 
             },
            feePreserve2:{
                allMoney: true
            },
            amountBack2:{
                allMoney: true
            },
            principleEnforce:{
                allMoney: true
            },
            interestEnforce:{
                allMoney: true
            },
            penaltyEnforce:{
                allMoney: true
            },
            totalEnforce:{
                allMoney: true
            },
            judge_preserve2:{
            	chinese:true
            },
            targetsCourt:{
                allMoney: true
            },
            numAmortized:{
                allMoney: true
            },
            principalAmortized:{
                allMoney: true
            },
            interestAmortized:{
                allMoney: true
            },
            numSurplus:{
                allMoney: true
            },
            principalSurplus:{
                allMoney: true
            },
            interestSurplus:{
                allMoney: true
            },
            targetsEnforced:{
                allMoney: true
            },
            targetsCourtSecond:{
                allMoney: true
            },
            judgeEnforce:{
            	chinese:true
            }
         },
         //重写showErrors
         showErrors: function (errorMap, errorList) {
             $.each(errorList, function (i, v) {
                 layer.tips(v.message, v.element, { time: 1000 });
                 return false;
             });  
         },
         /* 失去焦点时验证 */
         onfocusout: function(element) { $(element).valid(); },
         /*  键盘抬起不验证 */
         onkeyup:false,
      });
    
    $("#commentForma").validate({
    	rules: {
    		totalAmountMarginAdvance:{
        		 allMoney: true,
        	},
        	totalAmountMarginTakeback:{
	       		 allMoney: true,
	       	},
	       	amountIndemnity:{
	       		 allMoney: true,
	       	},
	       	balanceMarginAdvance:{
	       		 allMoney: true,
	       	},
	       	totalAmountAdvance:{
	       		 allMoney: true,
	       	},
	       	totalAmountTackback:{
	       		 allMoney: true,
	       	},
	       	balanceAdvance:{
	       		 allMoney: true,
	       	},
	       	totalBalanceAdvance:{
	       		 allMoney: true,
	       	},
    	},
        //重写showErrors
        showErrors: function (errorMap, errorList) {
            var msg = "";
            $.each(errorList, function (i, v) {
                layer.tips(v.message, v.element, { time: 2000 });
                return false;
            });  
        },
        /* 失去焦点时验证 */
        onfocusout: function(element) { $(element).valid(); },
        /*  键盘抬起不验证 */
        onkeyup:false,
    });
    
});